package com.tengju.data.domain.model.report;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum AchievementBonusCalTypeEnum {
    /* 每小时任务根据实时数据计算 */
    REALTIME((byte)1,"每小时实时任务"),

    /* 每月快照任务，根据每月快照数据计算 */
    MONTH((byte)2,"每月快照计算"),

    /* 每月快照任务，根据每月快照数据计算 */
    MONTH_RISK((byte)3,"每月风控对比计算");

    byte type;
    String desc;

    AchievementBonusCalTypeEnum(byte type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static AchievementBonusCalTypeEnum parseByType(byte type) {
        return Arrays.stream(AchievementBonusCalTypeEnum.values())
                .filter(k -> k.getType() == type)
                .findFirst().orElse(null);
    }
}
